Skip to content

Fix defines created by CMake configure_file#251

Merged
JieyangChen7 merged 1 commit into
CODARcode:masterfrom
kmorel:config-defines
Jan 2, 2026
Merged

Fix defines created by CMake configure_file#251
JieyangChen7 merged 1 commit into
CODARcode:masterfrom
kmorel:config-defines

Conversation

@kmorel

@kmorel kmorel commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Recent versions of CMake must have changed how variables created from option commands were substituted in the configure_file command. Previously, they substituted to ON or OFF, but now they substitute for TRUE or FALSE. This causes a problem with how MGARDXConfig.h matched strings to set the MGARD_ENABLE_X macros.

This change replaces string substitution with #cmakedefine01, which will simply replace the statement with a #define setting the variable to either 0 or 1, which is the desired outcome.

Recent versions of CMake must have changed how variables created from
`option` commands were substituted in the `configure_file` command.
Previously, they substituted to `ON` or `OFF`, but now they substitute
for `TRUE` or `FALSE`. This causes a problem with how MGARDXConfig.h
matched strings to set the `MGARD_ENABLE_X` macros.

This change replaces string substitution with `#cmakedefine01`, which
will simply replace the statement with a `#define` setting the variable
to either 0 or 1, which is the desired outcome.
@kmorel

kmorel commented Nov 11, 2025

Copy link
Copy Markdown
Contributor Author

@JieyangChen7 I got some nasty compile errors when trying to compile MGARD recently. There must have been some subtle changes with how CMake's configure_file command works.

These changes fix the problem. This may be worthy of patch releases.

@kmorel

kmorel commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

@JieyangChen7 ping

@JieyangChen7 JieyangChen7 merged commit 25f4b5b into CODARcode:master Jan 2, 2026
6 checks passed
@JieyangChen7

Copy link
Copy Markdown
Collaborator

@kmorel Sorry about the delay. It is merged now. Thanks for fixing the issue.

@kmorel kmorel deleted the config-defines branch January 2, 2026 18:35
@kmorel

kmorel commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

Excellent. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants